import javax.swing.JOptionPane;


public class UserInterface {
	private MainFrame frame;
	
	public UserInterface() {
        //Create and set up the window.
        frame = new MainFrame("agrimoo", this);
        frame.setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        frame.setVisible(true);
	}
	public void update() {
		frame.foodlabel.setText("Food: " + Client.p.food);
		frame.woodlabel.setText("Wood: " + Client.p.wood);
		frame.claylabel.setText("Clay: " + Client.p.clay);
		frame.reedlabel.setText("Reed: " + Client.p.reed);
		frame.stonelabel.setText("Stone: " + Client.p.stone);
		String chats = "<html><font face=\"sans-serif\"";
		for(Chat.Message m : Client.game.chat.messages) {
			chats += m.message + "<br>";
		}
		frame.chatpane.setText(chats);
	}
	public void alert(String s) {
		JOptionPane.showMessageDialog(frame, s);
	}
	public String getstring(String prompt) {
		return JOptionPane.showInputDialog(frame,prompt);
	}
}
